package com.weh.booksystem.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author weh
 * @create 2023-06-26
 */
@Configuration
public class InterceptorConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new Interceptor()).addPathPatterns("/**/*.html")
                .excludePathPatterns("/index.html")
                .excludePathPatterns("/managelogin.html")
                .excludePathPatterns("/register.html")
                .excludePathPatterns("/static/assets")
                .excludePathPatterns("/static/dist");
    }
//
//    @Override
//    public void addResourceHandlers(ResourceHandlerRegistry registry) {
//        registry.addResourceHandler("/**").addResourceLocations("classpath:/static/assets").addResourceLocations("classpath:/static/dist");
//    }
}
